package com.fengplus.demo.config;

import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.UUID;

@Configuration
public class RabbitmqConfig {

    // 如果用rabbitTemplate.convertAndSend(routeKey, msg)，需要把队列加入bean
//    @Bean
//    public Queue queueA() {
//        return new Queue("queue.a");
//    }
//
//    @Bean
//    public Queue queueB() {
//        return new Queue("queue.b");
//    }

    @Bean
    public Exchange exchangeE() {
        return new TopicExchange("exchange.e");
    }

    @Bean
    public Queue routeFRpc() {
        return new Queue("route.f.rpc", false);
    }

    @Bean
    public Queue routeFReply() {
        return new Queue("route.f.reply", false);
    }

}
